#!/usr/bin/make -f

%:
	dh $@ --buildsystem=ruby --with ruby

override_dh_auto_clean:
	dh_auto_clean -O--buildsystem=ruby
	./build clean
	rm -rf doc_build

override_dh_install:
	./build all
	dh_install --buildsystem=ruby --with ruby
	install -d debian/ohcount/usr/lib/ruby/vendor_ruby/ohcount
	install -d debian/ohcount/usr/bin
	install -d debian/ohcount-doc/usr/share/doc/ohcount-doc
	cp bin/ohcount debian/ohcount/usr/bin/
	cp -R ruby/gestalt ruby/gestalt.rb ruby/ohcount.rb debian/ohcount/usr/lib/ruby/vendor_ruby/ohcount/
	# build doxygen
	mkdir doc_build
	cp -aR doc/* doc_build/
	(cd doc_build && doxygen Doxyfile)
	cp -aR doc_build/html/* debian/ohcount-doc/usr/share/doc/ohcount-doc
	rm -rf debian/ohcount/ruby

get-orig-source:
	uscan --force-download
